﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CFSystem.JXC.Model;
using CFSystem.JXC.IDAL;
using CFSystem.JXC.DALFactory;
using CFSystem.JXC.AccessDAL;


namespace CFSystem.JXC.BLL
{
    public class Brand 
    {
        // Get an instance of the Category DAL using the DALFactory
        // Making this static will cache the DAL instance after the initial load
        private static readonly IBrand dal = DALFactory.DataAccess.CreateBrand();

        public Brand()
        { }
        /// <summary>
        /// Method to get all categories
        /// </summary>										
        /// <returns>Generic List of CategoryInfo</returns>	   		
        public IList<BrandInfo> GetBrands()
        {
            return dal.GetBrands();
        }
        
         /// <summary>
         /// insert brand into db.
         /// </summary>
         /// <param name="brandName"></param>
        public void Insert(string brandName)
        {
            //check name
            
            //insert
            dal.InsertBrand(brandName);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="brandID"></param>
        public void Delete(int brandID)
        {
            dal.DelBrandByID(brandID);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="brandID"></param>
        /// <param name="updValue"></param>
        public void Update(int brandID, string updValue)
        {
            dal.UpdateBrandByID(brandID, updValue);
        }
    }
}
